package org.aurora.framework.boot.common.rpc.response;

import java.io.Serial;

/**
 * BaseResponse
 * <pre>
 * description:
 * create date: 2025-03-23 14:22:01
 * </pre>
 *
 * @author cao.yong
 */
public class BaseResponse implements RpcResponse {

    @Serial
    private static final long serialVersionUID = 1L;

    private final boolean success;
    private final int code;
    private final String message;

    public BaseResponse() {
        this(true, ResponseCode.SUCCESS.getValue(), ResponseCode.SUCCESS.name());
    }

    public BaseResponse(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean isSuccess() {
        return success;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
